package com.draven;

import com.draven.inter.IEmployee;
import com.draven.inter.impl.EmployeeA;
import com.draven.inter.impl.EmployeeB;

import java.util.HashMap;
import java.util.Map;

public class Leader implements IEmployee {
    private Map<String, IEmployee> employee = new HashMap<String, IEmployee>();

    public Leader() {
        employee.put("e虫", new EmployeeA());
        employee.put("海报图", new EmployeeB());
    }

    @Override
    public void doing(String task) {
        if (!employee.containsKey(task)) {
            System.out.println("这个任务" + task + "超出我的能力图");
            return;
        }
        employee.get(task).doing(task);
    }
}










